import re

str1 = 'abcdef'
# pattern = 'ab|cd'
pattern = '((ab)(cd))'
res = re.match(pattern,str1)
print(res)
# print(res.group())
# print(res.groups())
print(res.group(1))
print(res.group(2))
print(res.group(3))